package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)" json:"username"`
	Password string `gorm:"type:varchar(255)" json:"password"`
}

type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int" json:"uid"`
	Rid int `gorm:"type:int" json:"rid"`
}
type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(30)" json:"role_name"`
}

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int" json:"rid"`
	Nid int `gorm:"type:int" json:"nid"`
}
type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(30)" json:"node_name"`
}
type Person struct {
	gorm.Model
	PersonNo   string `gorm:"type:varchar(30)" json:"person_no"`   //配送员编号
	PersonName string `gorm:"type:varchar(30)" json:"person_name"` //配送员姓名
	PersonTel  string `gorm:"type:varchar(30)" json:"person_tel"`  //配送员电话
	PersonArea string `gorm:"type:varchar(30)" json:"person_area"` //配送员所在地区
}
type Order struct {
	gorm.Model
	OrderNo     string `gorm:"type:varchar(30)" json:"order_no"`     //订单编号
	OrderArea   string `gorm:"type:varchar(30)" json:"order_area"`   //配送订单地址
	OrderStatus string `gorm:"type:varchar(30)" json:"order_status"` //配送状态
	Pid         int    `gorm:"type:int" json:"pid"`                  //配送员订单
}
type PersonOrder struct {
	OrderId     int    `gorm:"type:int" json:"order_id"`             //订单id
	PersonNo    string `gorm:"type:varchar(30)" json:"person_no"`    //配送员编号
	PersonName  string `gorm:"type:varchar(30)" json:"person_name"`  //配送员姓名
	PersonTel   string `gorm:"type:varchar(30)" json:"person_tel"`   //配送员电话
	PersonArea  string `gorm:"type:varchar(30)" json:"person_area"`  //配送员所在地区
	OrderNo     string `gorm:"type:varchar(30)" json:"order_no"`     //订单编号
	OrderArea   string `gorm:"type:varchar(30)" json:"order_area"`   //配送订单地址
	OrderStatus string `gorm:"type:varchar(30)" json:"order_status"` //配送状态
}
